package com.example.weatherapp1.data.manager

import android.content.Context
import com.example.weatherapp1.data.local.WeatherDatabase

class ModelManager private constructor() {
    lateinit var weatherDatabase: WeatherDatabase

    companion object {
        @Volatile
        private var instance: ModelManager? = null

        fun getInstance(): ModelManager {
            return instance ?: synchronized(this) {
                instance ?: ModelManager().also { instance = it }
            }
        }
    }

    // 初始化所有数据模型
    fun init(context: Context) {
        weatherDatabase = WeatherDatabase.getInstance(context)
        // 可以在这里初始化其他模型
    }
}